package kr.hkit.powerjava.chapter21.work;
/* Ch21. PROGRAMMING 03 예외처리 */
class NotFoundException extends Exception{
	public NotFoundException() {
		super();
	}
}

public class TestEx{
	public static void main(String[] args) {
			System.out.println(searchArray());

	}
	
	public static int searchArray(){
		int[] arr = {1,2,3,4,6,7,8,9};
		int x = 10;
			for(int i = 0; i<arr.length; i++){
				if(x == arr[i]){
					return i;
				}
			}
			try{			
			throw new NotFoundException();
			}catch(NotFoundException e){
				System.out.println(e.getMessage());
			}
			return -1;
	}
}

